from django import forms
from models import *
from django.forms import ModelForm

class TestRunForm(ModelForm):
    class Meta:
        model = TestRun

class MGroupForm(ModelForm):
    class Meta:
        model = MGroup

class LocationForm(ModelForm):
    class Meta:
        model = Location

class SiteForm(ModelForm):
    class Meta:
        model = Site

class HWModeForm(ModelForm):
    class Meta:
        model = HWMode

class MachineForm(ModelForm):
    class Meta:
        model = Machine

class MachineMoreForm(ModelForm):
    class Meta:
        model = MachineMore

class JobForm(ModelForm):
    class Meta:
        model = Job

class TestRunExecForm(ModelForm):
    class Meta:
        model = TestRunExec

class MGroupAdminForm(ModelForm):
    class Meta():
        model=MGroup
        widgets = {
            'name':forms.TextInput(attrs={'style':'width:230px'}),
            'machine_type':forms.Select(attrs={'style':'width:230px'}),
            'os_release':forms.Select(attrs={'style':'width:230px'}), 
            'intg_type':forms.Select(attrs={'style':'width:230px'}),
            'dtbld_type':forms.Select(attrs={'style':'width:230px'}), 
            'testrun':forms.SelectMultiple(attrs={'style':'width:230px'}),
        } 
class MachineAdminForm(ModelForm):
    class Meta():
        model=Machine
        widgets = {
            'hostname':forms.TextInput(attrs={'style':'width:230px'}),
            'mac':forms.TextInput(attrs={'style':'width:230px'}),
            'ipaddr_type':forms.Select(attrs={'style':'width:230px'}),
            'owner':forms.Select(attrs={'style':'width:230px'}),
            'group':forms.Select(attrs={'style':'width:230px'}),
            'domain':forms.Select(attrs={'style':'width:230px'}),
            'location':forms.Select(attrs={'style':'width:230px'}),
            'hwmode':forms.Select(attrs={'style':'width:230px'}),
            'serial_no':forms.TextInput(attrs={'style':'width:230px'}),
            'sp_hostname':forms.TextInput(attrs={'style':'width:230px'}),
            'notification_email':forms.TextInput(attrs={'style':'width:230px'}),
            'comments':forms.Textarea(attrs={'style':'width:330px'}),
        }

